package main

func main() {

	nextNum := getSeq()
	println(nextNum())
	println(nextNum())
	println(nextNum())
	println(nextNum())
	println(nextNum())
	println(nextNum())
	nextNumOth := getSeq()
	println(nextNumOth())
	println(nextNumOth())
	println(nextNumOth())
	println(nextNumOth())
	println(nextNumOth())

}

// 返回值为函数的案例
func nestFunc(a, b int) func(a, b int) {
	return func(a, b int) {

	}
}

func getSeq() func() int {
	i := 0
	return func() int {
		i += 1
		return i
	}
}
